//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Web.UI;
using CommunityServer.Components;
using CommunityServer.Controls;

namespace CommunityServer.Discussions.Controls
{
	/// <summary>
	/// Summary description for ForumLinkBar.
	/// </summary>
	public class ForumLinkBar : TemplatedWebControl
	{
		public ForumLinkBar()
		{
		}

	    /// <summary>
	    /// Override this method to attach templated or external skin controls to local references.
	    /// </summary>
	    /// <remarks>
	    /// This will only be called if the non-default skin is used.
	    /// </remarks>
	    protected override void AttachChildControls()
	    {
			CSContext csContext = CSContext.Current;

	        Control cntrl =   FindControl("AuthUserOnly");
            if(cntrl != null) 
                cntrl.Visible = !csContext.User.IsAnonymous;

			Control cntrl2 =   FindControl("TaggingOnly");
			if(cntrl2 != null) 
				cntrl2.Visible = CommunityServer.Discussions.Components.ForumConfiguration.Instance().EnableTagging;
	    }
	}
}
